//
//  NSString+NullFilter.m
//  YiDian
//
//  Created by majia on 2018/7/16.
//  Copyright © 2018年 Jeagine. All rights reserved.
//

#import "NSString+NullFilter.h"

@implementation NSString (NullFilter)

+ (NSString*) filterNull:(NSString *)targetString withMarkString:(NSString*)markString {
    
    NSString *handleString = nil;
    bool isNull = !targetString || [targetString isKindOfClass:[NSNull class]] || [targetString isEqual:[NSNull null]];
    
    if(isNull) {
        if(!markString) {
            markString = @"";
        }
        handleString = [NSString stringWithFormat:@"%@",markString];
    } else {
        handleString = targetString.copy;
    }
    
    return handleString;
}
@end
